<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            width: 100%;
            background: green;
            height: 50px;
        }
        /* 最大生效宽度400px   只有小于400px才生效 */
        @media (max-width:400px) {
            .box{
                background:red;
            }
        }
    
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>